<div style="{{$style??''}}">
    <div id="{{$id}}" style="width: 100%;height:100%;">加载中....</div>
</div>
<script>
    $(function () {
        var chart_{{$id}} = echarts.init(document.getElementById('{{$id}}'), null, {renderer: 'canvas'});
        chart_{{$id}}.setOption({
            title: {
                text: "{{$title}}",
                left: 'left'
            },
            tooltip: {
                trigger: 'item',
                formatter: '{b} : {c} ({d}%)',
            },
            legend: {
                orient: 'vertical',
                left: 'left',
                data: []
            },
            series: [
                {
                    type: 'pie',
                    radius: '55%',
                    // color: ['#7EC0EE', '#FF9F7F', '#FFD700', '#C9C9C9', '#E066FF', '#C0FF3E'],
                    label: {
                        formatter: '{b}: {c} ({d}%)'
                    },
                    data: [
                            @foreach($data as $k=>$v)
                        {
                            value: '{{$v}}', name: '{{$k}}'
                        },
                        @endforeach
                    ]
                }
            ]
        });
    });
</script>
